#!/bin/bash

# SPAM3UK 服务器连接脚本
# 快速SSH连接到生产服务器

SERVER="118.145.200.164"
USER="anders"
PASSWORD="nHC83lCH0r1KcaIzF00Y6w=="
PORT="22"

echo "🔐 连接到SPAM3UK生产服务器..."
echo "服务器: $USER@$SERVER:$PORT"
echo "部署目录: /data/prod/spam3uk"
echo "服务端口: 5700"
echo "================================"

# 使用sshpass自动输入密码连接
if command -v sshpass &> /dev/null; then
    sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no $USER@$SERVER -p $PORT
else
    echo "提示: 安装sshpass可以自动输入密码"
    echo "Ubuntu: sudo apt install sshpass"
    echo "macOS: brew install sshpass"
    echo
    echo "手动连接命令:"
    echo "ssh $USER@$SERVER -p $PORT"
    echo "密码: $PASSWORD"
    
    # 尝试手动连接
    ssh -o StrictHostKeyChecking=no $USER@$SERVER -p $PORT
fi
